<?php
/**
 * Created by PhpStorm.
 * User: jieai
 * Date: 2017-04-04
 * Time: 23:09
 */
namespace Home\Model;

use Think\Model\RelationModel;
class RecordRelationModel extends RelationModel{
    protected $tableName='gsrecord';

    protected $_link=array(
        'member'=>array(
            'class_name' => 'member',
            'mapping_type'=>self::MANY_TO_MANY,
            'foreign_key'=>'gsrecord_id',
            'relation_foreign_key'=>'member_id',
            'relation_table' => 'gs_member_gsrecord'



        ),
        'station'=>array(
            'class_name' => 'station',
            'mapping_type'=>self::BELONGS_TO,
            'foreign_key'=>'station_id',

            'as_fields'=>'name'

        ));
}